package com.egglazy.Config;


import com.egglazy.Utils.Result;
import com.egglazy.Utils.ResultUtil;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionConfig {

    @ExceptionHandler(Exception.class)
    public Result<String> handleException(Exception e) {
        return ResultUtil.error(e.getClass().getName() + ":" + e.getMessage());
    }

}
